********************************************************************************
* This program sets the files paths to run the code and generate the output
* set it to the folder where you have downloaded the git files
*
* Authors: Fowlie and Reguant
* August 2020
********************************************************************************

if  "`c(username)'" == "mreguant" {
	global dirpath "/Users/mreguant/Documents/git/leakage"
	global buildpath "$dirpath/0_build"
	global analyzepath "$dirpath/1_analyze"
	global producepath "$dirpath/2_produce"
}

if "`c(username)'"=="meredith"{
global dirpath "/Users/meredith/Dropbox/GitHub/leakage/"
	global buildpath "$dirpath/0_build"
	global analyzepath "$dirpath/1_analyze"
	global producepath "$dirpath/2_produce"

}

* installing libraries (we might have unadvertedly forgotten to mention some)
/*
foreach command in "reghdfe" "ftools" "gtools" "carryforward" "moremata" "ivreg2" "ivreghdfe" "ranktest" {
	ssc install `command'
}
* also need to install bacon with pkg 
net install st0197.pkg
*/

* some useful paths to define for data access, create directories for outputs, etc.
cap mkdir $buildpath/output
cap mkdir $analyzepath/output
cap mkdir  $producepath/output

global crosswalks = "$buildpath/input/crosswalks"
	
global ASMraw = "$buildpath/input/ASM"
global ASM = "$buildpath/output/ASM"
cap mkdir $ASM

global MECSraw = "$buildpath/input/MECS"
global MECSenergy = "$buildpath/output/MECS"
cap mkdir $MECSenergy

global QCEWraw = "$buildpath/input/QCEW"
global QCEW = "$buildpath/output/QCEW"
cap mkdir $QCEW
cap mkdir "$QCEW/raw"

global SEDSraw = "$buildpath/input/SEDS"
global SEDS = "$buildpath/output/SEDS"
cap mkdir $SEDS
cap mkdir "$SEDS/raw"

global EIraw  "$buildpath/input/EI"
global EI  "$buildpath/output/EI"
cap mkdir $EI

global Schottraw  "$buildpath/input/Schott"
global Schott  "$buildpath/output/Schott"
cap mkdir $Schott

global IOraw  "$buildpath/input/IOtables"
global IO  "$buildpath/output/IOtables"
cap mkdir $IO

global exiobase  "$buildpath/output/exiobase"
cap mkdir $exiobase

global misato = "$buildpath/input/misato_sato"

global energy_merged = "$buildpath/output/energy_merged"
global energy_price = "$buildpath/output/energy_price"
cap mkdir $energy_merged
cap mkdir $energy_price

global result_regs = "$analyzepath/output/regressions"
cap mkdir $results_regs

global result_simul = "$analyzepath/output/simulations"
cap mkdir $result_simul

global tables = "$producepath/output/tables"
cap mkdir  $producepath/output/tables

global figures = "$producepath/output/figures"
cap mkdir  $producepath/output/figures
